#!/usr/bin/expect

# sudo apt-get install tcl tk expect

# http://quxiao.github.io/blog/2012/05/13/add-startup-programe-with-expect/


set userName root 
set hostname 192.168.100.219
set passwd   rootroot

#spawn scp /tmp/test.sh $userName@$hostname:/home/$userName/scp_test.sh
#spawn scp  -r mc_offline.py $userName@$hostname:/usr/lib/python2.7/site-packages/salt/runners/mc_offline_debug.py
#spawn scp  -r mc_offline.py $userName@$hostname:/root/mc_offline_debug.py
spawn scp  -r ../virt-mgr  $userName@$hostname:/root/


expect "password:"
send "$passwd\n"
interact

#spawn ssh $userName@$hostname
#expect "password:"
#send "$passwd\n"
#expect "\$ "
#spawn touch 22222.txt
#interact

